from enum import Enum, unique, auto


class Color(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3


@unique
class Color2(Enum):  # 不允许有重复的值
    RED = 1
    GREEN = 2
    BLUE = 3


class Color3(Enum):  # 使用自动设定的值
    RED = auto()
    GREEN = auto()
    BLUE = auto()


def test(enum_obj):
    print(enum_obj)
    for attr in enum_obj:
        print(attr, attr.name, attr.value)


test(Color)
test(Color2)
test(Color3)

print('=' * 50)
print(Color3(3))
